<template>
  <view>
    <u-cell-group>
      <u-cell isLink="true" @click="b" url='/pkg-house/add-houseinfo/add-houseinfo'>
        <view slot="title" class="u-slot-title">
          <text class="u-cell-text">{{loudong.name}}1号楼101</text>
        </view>
      </u-cell>
      <u-cell isLink="true" @click="b2" url='/pkg-house/add-houseinfo/add-houseinfo'>
        <view slot="title" class="u-slot-title">
          <text class="u-cell-text">{{loudong.name}}2号楼102</text>
        </view>2
      </u-cell>
      <u-cell isLink="true" @click="b3" url='/pkg-house/add-houseinfo/add-houseinfo'>
        <view slot="title" class="u-slot-title">
          <text class="u-cell-text">{{loudong.name}}3号楼103</text>
        </view>
      </u-cell>
      <u-cell isLink="true" @click="b4" url='/pkg-house/add-houseinfo/add-houseinfo'>
        <view slot="title" class="u-slot-title">
          <text class="u-cell-text">{{loudong.name}}4号楼201</text>
        </view>
      </u-cell>
      <u-cell isLink="true" @click="b5" url='/pkg-house/add-houseinfo/add-houseinfo'>
        <view slot="title" class="u-slot-title">
          <text class="u-cell-text">{{loudong.name}}4号楼202</text>
        </view>
      </u-cell>
      <u-cell isLink="true" @click="b6" url='/pkg-house/add-houseinfo/add-houseinfo'>
        <view slot="title" class="u-slot-title">
          <text class="u-cell-text">{{loudong.name}}4号楼203</text>
        </view>
      </u-cell>
    </u-cell-group>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        loudong: '',
        loudong1: '',
        loudong2: '',
        loudong3: '',
        loudong4: ''
      };
    },
    onLoad() {
      this.loudong = uni.getStorageSync('loudong')
    },
    methods: {
      b() {
        this.loudong1 = this.loudong.name + '1号楼' + "" + "101"
        this.$store.commit('user/setUnit', this.loudong1)
        uni.setStorageSync('unit', this.loudong1)
        console.log(this.loudong1);
      },
      b2() {
        this.loudong1 = this.loudong.name + '2号楼' + "" + '102'
        this.$store.commit('user/setUnit', this.loudong1)
        uni.setStorageSync('unit', this.loudong1)
        console.log(this.loudong1);
      },
      b3() {
        this.loudong1 = this.loudong.name + '3号楼' + "" + "103"
        this.$store.commit('user/setUnit', this.loudong1)
        uni.setStorageSync('unit', this.loudong1)
        console.log(this.loudong1);
      },
      b4() {
        this.loudong1 = this.loudong.name + '4号楼' + "" + "201"
        this.$store.commit('user/setUnit', this.loudong1)
        uni.setStorageSync('unit', this.loudong1)
        console.log(this.loudong1);
      },
      b5() {
        this.loudong1 = this.loudong.name + '4号楼' + "" + "202"
        this.$store.commit('user/setUnit', this.loudong1)
        uni.setStorageSync('unit', this.loudong1)
        console.log(this.loudong1);
      },
      b6() {
        this.loudong1 = this.loudong.name + '4号楼' + "" + "203"
        this.$store.commit('user/setUnit', this.loudong1)
        uni.setStorageSync('unit', this.loudong1)
        console.log(this.loudong1);
      }
    }
  }
</script>

<style lang="less">

</style>
